#include "OptionsPage.h"

#include "../Utils/Vector2D.h"
#include "../Settings.h"
#include "../Game.h"

#include "LinkTo.h"

#include "OptionPage.h"

#include <string>
#include <vector>

OptionsPage::OptionsPage()
{
    current_item = 0;
    current_top_item = 0;
    num_items = 1;
    items.push_back(new LinkTo("main"));

    // for each setting section

    std::vector<std::string> sections = Settings::instance().getSections();

    std::vector<std::string>::iterator it;
    for (   it = sections.begin();
            it != sections.end();
            ++it) {
        std::string section = *it;
        // create a link to that optionpage
        items.push_back(new LinkTo(section));
        // tell the game to add that page
        Game::instance().addPage(section, new OptionPage(section));
        num_items++;
    }


    title = "options";
//    std::cerr << "init optionspage\n";
}

OptionsPage::~OptionsPage() {}
